<template>
	<view>
		<view class="box4">
			<view>导航跳转的学习</view>
			<navigator url="../list/list?id=80&age=19" open-type="navigate">保留上级页跳转到list</navigator>
<!-- 			 这里做了一个参数的传递，在地址栏后加上了问号，问号后是需要传递的参数，&号后是第二个参数
			 参数会以键值对的形式传递，也可以通过编程式导航去传递 -->
			<view>a lot of space</view>
			<navigator url="../index/index" open-type="switchTab">跳转回主页</navigator>
<!-- 			<navigator url="../list/list" open-type="redirect">重定向到list</navigator> -->
<!-- 			重定向会结束页面的生命周期 -->
			<button @click="turnTo">跳转到detail</button>
			<button @click="turnToBar">跳转到主页</button>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
			<view>a lot of space</view>
		</view>
	</view>
</template>

<script>
	export default {

		data() {
			return {
			}
		},
		onPullDownRefresh() {
			uni.stopPullDownRefresh()
		},
		onReachBottom(){
			uni.switchTab({
				url:'../contact/contact',
				success() {
					console.log('下拉跳转成功')
				}
			})
		},
		methods: {
			turnTo(){
				uni.navigateTo({
					url:'../list/list',
					success() {
						console.log('跳转到detail成功')
					}
				})
			},
			turnToBar(){
				uni.switchTab({
					url:'../index/index',
					success() {
						console.log('跳转到主页成功')
					}
				})
			},
		}
	}
</script>

<style>
	.box4{
		height: 200px;
		line-height: 400px;
	}
</style>
